home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2394 < prev    next >
Encoding:
Text File  |  1996-08-05  |  815 b   |  37 lines

  1. Path: su3.in.net!news
  2. From: poundss@in.net (Sam Pounds)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Pointer Conversion
  5. Date: Sun, 21 Jan 1996 02:17:01 GMT
  6. Organization: INTERNET Indiana
  7. Message-ID: <4ds6s3$ft6@su3.in.net>
  8. References: <4ds4jq$fo4@su3.in.net>
  9. NNTP-Posting-Host: pm2-17.in.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. poundss@in.net (Sam Pounds) wrote:
  13.  
  14.  
  15. >char *my_strcat(const char *a, const char *b)
  16. >{
  17. >    char done[1024];
  18. >    char *p = done;
  19.  
  20. >    while (*a)
  21. >      *p++ = *a++;
  22. >    while (*b)
  23. >      *p++ = *b++;
  24. >    *p = '\0';
  25. >    return done; /* this is the suspicious pointer conversion error */
  26. >}
  27.  
  28. Sorry, it just dawned on me.
  29. char *done = (char *)malloc(1024);
  30.  
  31. But if anyone could tell me how I could just alloc the
  32. necessary memory for the two pointers I would appreciate it.
  33. Sorry again.
  34.  
  35.  
  36.  
  37.